package com.yili.oa.service.impl;

import com.yili.oa.dao.RankingListMapper;
import com.yili.oa.models.RankingList;
import com.yili.oa.models.RankingListExample;
import com.yili.oa.service.RankingListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(value = "transactionManager")
public class RankingListServiceImpl implements RankingListService {

    @Autowired
    RankingListMapper mapper;

    @Override
    public List<RankingList> get(Integer type) {
        RankingListExample example = new RankingListExample();
        RankingListExample.Criteria criteria = example.createCriteria();
        criteria.andTypeEqualTo(type);
        return mapper.selectByExample(example);
    }
}
